package com.design.javaManage.utils;


import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.List;


@EqualsAndHashCode(callSuper = true)
@Data
public class PageResult extends Result implements Serializable {



    //总记录数
    @ApiModelProperty("总记录数")
    private long total;


    //分页的数据
    @ApiModelProperty("分页的数据列表")
    private List<?> row;

    public PageResult(long total, List<?> list){
        this.setFlag(true);
        this.setMessage("分页查询成功");
        this.total = total;
        this.row = list;
    }


    // total 分页总条数  list 分页数据列表

    public static Result pageResult(long total, List<?> list) {
        return new PageResult(total,list);
    }
}
